<?php 
	// pr($bookmaker["Links"]);
	$langlist = $this->Session->read("langlist");
    $valuteTotal = $this->Session->read("valutalist");
    $pagamenti = $this->Session->read("pagamentolist");
    $categorieTotal = $this->Session->read("categorylist");
?>
<link rel="stylesheet" href="<?php echo $this->webroot;?>css/bootstrap-tagsinput.css"/>
<script type="text/javascript" src="<?php echo $this->webroot;?>js/typeahead.min.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot;?>js/bootstrap-tagsinput.min.js"></script>
<h1 class="text-center"><?php echo __("Bookmaker - %s", $bookmaker["Bookmaker"]["nome"]); ?></h1>
	<div class="row">
          <div class="col-md-3">
              <a href="<?php echo $this->webroot?>Bookmakers/links/<?php echo $bookmaker["Bookmaker"]["id"]; ?>"><img class="thumbnail" id="logo" src="<?php echo $this->webroot.$bookmaker["Logo"]["webpath"];?>"></a>
          </div>
          <div class="col-md-9">
			<div class="row">
	          <div class="col-md-12" style="text-align: justify">
		        <?php echo html_entity_decode($bookmaker["BookmakerLang"][Configure::read("Config.language")]["descrizione"] ,ENT_QUOTES);?>
	          </div>
	          <br>
	        </div>
			<div class="row">
	          <div class="col-md-12">
	            <label for="valutazione"><?php echo __("Valutazione"); ?>:</label>
			       	<?php echo $this->element('star',array("valutazione"=>$bookmaker["Bookmaker"]["valutazione"])); ?>
	          </div>   
	        </div>
			<div class="row">
	          <div class="col-md-12">
	            <label for="email"><span class="glyphicon glyphicon-envelope"></span>&nbsp;</label><?php echo $bookmaker["Bookmaker"]["email"];?>
	          </div>  
	        </div>
			<div class="row">
	          <div class="col-md-12">
	            <label for="telefono"><span class="glyphicon glyphicon-phone-alt"></span>&nbsp;</label><?php echo $bookmaker["Bookmaker"]["telefono"];?>
	          </div>   
	        </div>
			<div class="row">
	          <div class="col-md-12">
	            <label for="fax"><span class="glyphicon glyphicon-print">&nbsp;</label><?php echo $bookmaker["Bookmaker"]["fax"];?>
	          </div>   
	        </div>
			<div class="row">
	          <div class="col-md-6">
	            <label for="mobile"><?php echo __("Mobile"); ?>:</label>
	            <span class="glyphicon glyphicon-<?php echo $bookmaker["Bookmaker"]["mobile"]?"ok":"remove"; ?>" style="color:<?php echo $bookmaker["Bookmaker"]["mobile"]?"green":"red"; ?>;" ></span>
	          </div>   
	          <div class="col-md-6">
	            <label for="streaming"><?php echo __("Streaming"); ?>:</label>
	            <span class="glyphicon glyphicon-<?php echo $bookmaker["Bookmaker"]["streaming"]?"ok":"remove"; ?>" style="color:<?php echo $bookmaker["Bookmaker"]["streaming"]?"green":"red"; ?>;" ></span>
	          </div>   
	        </div>
			<div class="row">
	          <div class="col-md-6">
	            <label for="bonus"><?php echo __("Bonus");?>:&nbsp;</label><?php echo $bookmaker["Bookmaker"]["bonus"];?>
	          </div>   
	          <div class="col-md-6">
	            <label for="maxbonus"><?php echo __("Max Bonus");?>:&nbsp;</label><?php echo $bookmaker["Bookmaker"]["max_importo_bonus"];?>
	          </div>   
	        </div>
			<div class="row">
	          <div class="col-md-6">
	            <label for="puntmin"><?php echo __("Puntata Minima");?>:&nbsp;</label><?php echo $bookmaker["Bookmaker"]["puntata_minima"];?>
	          </div>   
	          <div class="col-md-6">
	            <label for="versmin"><?php echo __("Versamento Minimo");?>:&nbsp;</label><?php echo $bookmaker["Bookmaker"]["versamento_minimo"];?>
	          </div>   
	        </div>
			<div class="row">
	          <div class="col-md-12">
	            <label for="verprelminsmin"><?php echo __("Prelievo Minimo");?>:&nbsp;</label><?php echo $bookmaker["Bookmaker"]["prelievo_minimo"];?>
	          </div>   
	        </div>
			<div class="row">
	          <div class="col-md-12">
	            	<label for="categorie"><?php echo __("Categorie");?>:&nbsp;</label>
	            	<?php foreach(explode(",", $bookmaker["Bookmaker"]["categoria"]) as $categoria){ 
	                        if($categoria){?>
	                            <label class="label label-warning" > <?php echo $categorieTotal[$categoria] ?></label>
	                <?php }}?>
	          </div> 
	        </div>
			<div class="row">
	          <div class="col-md-12">
	            	<label for="valuta"><?php echo __("Valuta");?>:&nbsp;</label>
	                <?php foreach(explode(",", $bookmaker["Bookmaker"]["valuta"]) as $valuta){ 
	                        if($valuta){?>
	                            <label title="<?php echo $valuteTotal[$valuta]["name"]; ?>" class="label label-warning" > <?php echo $valuteTotal[$valuta]["code"]; ?></label>
	                <?php }}?>
	          </div>
	        </div>
			<?php if(false) { ?>
			    <div class="row">
		          <div class="form-group col-md-12">
		            <table class="table table-condensed">
		                 <thead>
			                <tr style="background-color:#414141;color:#fff;">
			                     <th></th>
			                     <th><?php echo __("Metodo di pagamento"); ?></th>
			                     <th><?php echo __("Commissione versamento"); ?></th>
			                     <th><?php echo __("Tempo accredito versamento"); ?></th>
			                     <th><?php echo __("Commissione prelievo"); ?></th>
			                     <th><?php echo __("Tempo accredito prelievo"); ?></th>
			                </tr>
		                 </thead>
		                 <?php foreach($bookmaker["Pagamento"] as $pagamento){ ?>
		                      <tr>
		                          <td style="vertical-align:middle;">
				                	<a style="text-decoration: underline;" href='<?php echo $this->webroot; ?>Bookmaker/<?php echo $bookmaker["Bookmaker"]["nome_slug"]; ?>/<?php echo $this->Session->read("Config.language")=="ita"?"metodo-pagamento":"payment-method"; ?>/<?php echo $pagamento["Metodo"]["CategoryLang"][0]["name_slug"]; ?>'>
										<div class="<?php echo $pagamento["Metodo"]["code"]; ?>" ></div>
				                	</a>
		                          </td>
		                          <td style="vertical-align:middle;">
				                	<a style="text-decoration: underline;" href='<?php echo $this->webroot; ?>Bookmaker/<?php echo $bookmaker["Bookmaker"]["nome_slug"]; ?>/<?php echo $this->Session->read("Config.language")=="ita"?"metodo-pagamento":"payment-method"; ?>/<?php echo $pagamento["Metodo"]["CategoryLang"][0]["name_slug"]; ?>'>
					                	<?php echo $pagamento["Metodo"]["CategoryLang"][0]["name"]; ?>
				                	</a>
								  </td>
		                          <td style="vertical-align:middle;"><?php echo $pagamento["PagamentoLang"][0]["commissione_versamento"]; ?></td>
		                          <td style="vertical-align:middle;"><?php echo $pagamento["PagamentoLang"][0]["tempo_accredito_versamento"]; ?></td>
		                          <td style="vertical-align:middle;"><?php echo $pagamento["PagamentoLang"][0]["commissione_prelievo"];; ?></td>
		                          <td style="vertical-align:middle;"><?php echo $pagamento["PagamentoLang"][0]["tempo_accredito_prelievo"]; ?></td>
		                      </tr>
		                 <?php }?>
		            </table>
		          </div>      
	            </div>
            <?php } else { ?>
				<div class="row">
		          <div class="col-md-12">
		            	<label for="valuta"><?php echo __("Medoto di Pagamento");?>:&nbsp;</label>
		                <?php foreach($bookmaker["Pagamento"] as $pagamento){ ?>
		                	<a  href='<?php echo $this->webroot.Configure::read("Config.lang"); ?>/bookmaker/<?php echo $bookmaker["Bookmaker"]["nome_slug"]; ?>/<?php echo $this->Session->read("Config.language")=="ita"?"metodo-pagamento":"payment-method"; ?>/<?php echo $pagamento["Metodo"]["CategoryLang"][0]["name_slug"]; ?>'>
			                	<label class="label label-warning" style="text-decoration: underline; cursor: pointer;" > <?php echo $pagamento["Metodo"]["CategoryLang"][0]["name"]; ?></label>
		                	</a>
		                <?php }?>
		          </div>
		        </div>
	        <?php }?>
	        
          </div>


	</div>
	<div class="row">
          <div class="col-md-12">
	           <h3 class="text-center"><?php echo __("Registrati"); ?></h3>

	           <div class="row">
			       <?php foreach($bookmaker["Links"] as $link){ ?>
			       	<div class="col-md-2">
		    	       <nobr><a href="<?php echo $link["link"]; ?>" target="_blank" class="link" ><i class="<?php echo "famfamfam-flag-".$langlist[$link["lang_id"]]["code"]; ?>"></i>&nbsp;<?php echo $langlist[$link["lang_id"]]["name"]; ?></a></nobr>
		           </div>
		           <?php }?>
	           </div>
	           
          </div>      
	</div>

  <script>
	
    
    function format(data) {
        console.log(data);
        return "<img class='banner_thumb' src='<?php echo $this->webroot?>" + data.id + "'/>" + data.text;
    }
    
    $(".link").on("click",function(e){
        // e.preventDefault();
        ga('send','event','view','click','newuser');
        // return true;
    });
      
  </script>